# $Id$
# Maintainer: Andreas Radke <andyrtr@archlinux.org>

pkgname=libdca
pkgver=0.0.6
pkgrel=1
pkgdesc="Free library for decoding DTS Coherent Acoustics streams"
arch=('x86_64')
license=('GPL')
url="https://www.videolan.org/developers/libdca.html"
depends=('sh')
provides=('libdts')
replaces=('libdts')
options=('!emptydirs')
source=(https://download.videolan.org/pub/videolan/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2)
sha512sums=('d264128019e7fd295a35691636311f81960c17802dbbc67764c4e00b2fdf12ebc69b057a4947b57551a130e5cfd1fef3fe3558c7067216ea04a0b6bbb881b4f1')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --mandir=/usr/share/man --disable-static
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="${pkgdir}" install

  rm -f "${pkgdir}/usr/share/man/man1"/{extract_dts,dtsdec}.1
  ln -s dcadec.1.gz "${pkgdir}/usr/share/man/man1/dtsdec.1.gz"
  ln -s extract_dca.1.gz "${pkgdir}/usr/share/man/man1/extract_dts.1.gz"
  rm -f "${pkgdir}/usr/lib/libdts.a"
}
